package cn.tedu.charging.common.pojo;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class JsonResult<T> {

    Integer code;

    String message;

    T data;

    public static<T> JsonResult<T> ok(T data,String message){
        JsonResult<T> result = new JsonResult<>();
        result.setData(data);
        result.setCode(2000);
        result.setMessage(message);
    	return result;
    }
}
